<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Window</title>
</head>
<body>

</body>
<script>
    //定时器
    function fun(){
        alert("该起床了！");
    }
    // let timerId = setTimeout("fun();",1000);
    /*let timerId = setTimeout(fun,1000);
    clearInterval(timerId);*/
    // let timerId = setInterval("fun();",1000);
    let timerId =setInterval(fun,1000);
    // clearInterval(timerId);
</script>
</html>